package part2;

public class HouseDirector {
    private HouseBuilder houseBuilder;

    public HouseDirector(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    public HouseBuilder getHouseBuilder() {
        return houseBuilder;
    }

    public void setHouseBuilder(HouseBuilder houseBuilder) {
        this.houseBuilder = houseBuilder;
    }

    // 建造房子交给指挥者来处理。然后返回具体的房子
    public House constructHouse() {
        houseBuilder.buildFoundation();
        houseBuilder.buildWall();
        houseBuilder.buildRoof();
        return houseBuilder.build();
    }
}
